package prototype;

public class House implements Cloneable{
    private Dog dog;
    private String color;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Object clone = super.clone();
        ((House) clone).setDog(((Dog) dog.clone()));
        return clone;
    }

    @Override
    public String toString() {
        return "House{" +
                "dog=" + dog +
                ", color='" + color + '\'' +
                '}';
    }

    public Dog getDog() {
        return dog;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
